//
//  CYVideoTableViewCell.m
//  KCZ_B段项目
//
//  Created by dllo on 15/11/4.
//  Copyright © 2015年 Sky. All rights reserved.
//

#import "CYVideoTableViewCell.h"
#import "FitHeader.h"
#import <UIImageView+WebCache.h>
#import "FontSizeSingleTon.h"
#define FontSize [[FontSizeSingleTon shareFontSize]array]
@implementation CYVideoTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatViews];
    }
    return self;
}

-(void)creatViews
{
    _photoImage = [[UIImageView alloc]initWithFrame:CGRectMake(10 * wt, 5 * ht, 120 * wt, 90 * ht)];
    _photoImage.backgroundColor = [UIColor grayColor];
    [self addSubview:_photoImage];
    
    _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(_photoImage.frame.origin.x + _photoImage.frame.size.width + 10 * wt, _photoImage.frame.origin.y, 200 * wt, 30 * ht)];
    _titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:[FontSize[0] integerValue]];
    [self addSubview:_titleLabel];
    
    _timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(_titleLabel.frame.origin.x, _titleLabel.frame.origin.y + _titleLabel.frame.size.height, _titleLabel.frame.size.width, _titleLabel.frame.size.height)];
    _timeLabel.textColor = [UIColor grayColor];
    _timeLabel.font = [UIFont systemFontOfSize:[FontSize[2] integerValue]];
    [self addSubview:_timeLabel];
    
    _infoLabel = [[UILabel alloc]initWithFrame:CGRectMake(_timeLabel.frame.origin.x, _timeLabel.frame.origin.y + _timeLabel.frame.size.height, _timeLabel.frame.size.width + 20 * wt, _timeLabel.frame.size.height)];
    _infoLabel.textColor = [UIColor grayColor];
    _infoLabel.font = [UIFont systemFontOfSize:[FontSize[2] integerValue]];
    [self addSubview:_infoLabel];
}

-(void)setAllVideo:(CYAllVideoListModel *)allVideo
{
    if (_allVideo != allVideo) {
        _allVideo = allVideo;
    }
    _titleLabel.text = allVideo.Title;
    _timeLabel.text = allVideo.Collection;
    _infoLabel.text = allVideo.Stuff;
    [_photoImage sd_setImageWithURL:[NSURL URLWithString:allVideo.Cover]placeholderImage:[UIImage imageNamed:@"12090"]];
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
